package com.sojson.dao.impl;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import com.sojson.base.impl.BaseDaoImpl;
import com.sojson.dao.CashOutDao;
import com.sojson.entity.po.CashOut;

/**
 * 提现申请表Dao实现类(目的:把分页插件从Service层分离,这样就不用每次调Dao接口都要分页)
 * 
 * @author liu
 * @date 2021-03-16
 */
@Repository
public class CashOutDaoImpl extends BaseDaoImpl<CashOutDao, CashOut> implements CashOutDao {

    @Resource
    private CashOutDao cashOutDao;

    /**
     * 单条插入
     * 
     * @param cashOut
     * @return
     * @throws SQLException
     */
    @Override
    public int insert(CashOut cashOut) {
        return cashOutDao.insert(cashOut);
    }

    /**
     * 批量插入
     * 
     * @param cashOut
     * @return
     * @throws SQLException
     */
    @Override
    public int insertList(List<CashOut> cashOuts) {
        return cashOutDao.insertList(cashOuts);
    }

    /**
     * 通过对象批量删除(物理删除)
     * 
     * @param cashOut
     * @return
     * @throws SQLException
     */
    @Override
    public int deleteByDto(CashOut cashOut) {
        return cashOutDao.deleteByDto(cashOut);
    }

    /**
     * 统计全部数量
     * 
     * @return
     * @throws SQLException
     */
    @Override
    public int countAll() {
        return cashOutDao.countAll();
    }

    /**
     * 查询所有
     * 
     * @return
     * @throws SQLException
     */
    @Override
    public List<CashOut> listAll() {
        return cashOutDao.listAll();
    }

    /**
     * 根据对象统计数量
     * 
     * @param cashOut
     * @return
     * @throws SQLException
     */
    @Override
    public int countByDto(CashOut cashOut) {
        return cashOutDao.countByDto(cashOut);
    }

    /**
     * 根据对象查询
     * 
     * @param cashOut
     * @return
     * @throws SQLException
     */
    @Override
    public List<CashOut> listByDto(CashOut cashOut) {
        startPageDefaultSort(cashOut);
        return cashOutDao.listByDto(cashOut);
    }

    /**
     * 通过id删除(物理删除)
     * 
     * @param id
     * @return
     * @throws SQLException
     */
    @Override
    public int deleteById(Integer id) {
        return cashOutDao.deleteById(id);
    }

    /**
     * 通过id列表删除(物理删除)
     * 
     * @param ids
     * @return
     * @throws SQLException
     */
    @Override
    public int deleteByIdList(ArrayList<Integer> ids) {
        return cashOutDao.deleteByIdList(ids);
    }

    /**
     * 通过id更新(全部更新)
     * 
     * @param cashOut
     * @return
     * @throws SQLException
     */
    @Override
    public int updateById(CashOut cashOut) {
        return cashOutDao.updateById(cashOut);
    }

    /**
     * 通过id列表更新(全部更新)(更新内容相同)
     * 
     * @param cashOut
     * @return
     * @throws SQLException
     */
    @Override
    public int updateStaticByIdList(CashOut cashOut) {
        return cashOutDao.updateStaticByIdList(cashOut);
    }

    /**
     * 通过id列表更新(全部更新)(更新内容不相同)
     * 
     * @param cashOuts
     * @return
     * @throws SQLException
     */
    @Override
    public int updateChangeByIdList(ArrayList<CashOut> cashOuts) {
        return cashOutDao.updateChangeByIdList(cashOuts);
    }

    /**
     * 通过id更新(局部更新)
     * 
     * @param cashOut
     * @return
     * @throws SQLException
     */
    @Override
    public int updatePartialById(CashOut cashOut) {
        return cashOutDao.updatePartialById(cashOut);
    }

    /**
     * 通过id列表更新(局部更新)(更新内容相同)
     * 
     * @param cashOut
     * @return
     * @throws SQLException
     */
    @Override
    public int updateStaticPartialByIdList(CashOut cashOut) {
        return cashOutDao.updateStaticPartialByIdList(cashOut);
    }

    /**
     * 通过id列表更新(局部更新)(更新内容不相同)
     * 
     * @param cashOuts
     * @return
     * @throws SQLException
     */
    @Override
    public int updateChangePartialByIdList(ArrayList<CashOut> cashOuts) {
        return cashOutDao.updateChangePartialByIdList(cashOuts);
    }

    /**
     * 通过id查询
     * 
     * @param id
     * @return
     * @throws SQLException
     */
    @Override
    public CashOut findById(Integer id) {
        return cashOutDao.findById(id);
    }

    /**
     * 通过id列表查询
     * 
     * @param ids
     * @return
     * @throws SQLException
     */
    @Override
    public ArrayList<CashOut> findByIdList(ArrayList<Integer> ids) {
        return cashOutDao.findByIdList(ids);
    }

    /**
     * 通过对象查询id列表
     * 
     * @param cashOut
     * @return
     * @throws SQLException
     */
    @Override
    public ArrayList<Integer> findIdByDto(CashOut cashOut) {
        return cashOutDao.findIdByDto(cashOut);
    }

    /**
     * 清空数据(物理清空)
     * 
     * @throws SQLException
     */
    @Override
    public void clear() {
        cashOutDao.clear();
    }

}